﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Script.Serialization;

namespace MM.Data.Entity
{
    [Table("OperationTypes")]
    public class OperationType 
    {
        [Key, Column("Id")]
        public int OperationTypeId { get; set; }
        [MaxLength(30)]
        public string NameShort { get; set; }
        public string NameLong { get; set; }
        public bool IsIncome { get; set; }
        public int? ParentId { get; set; }
        [Column("Depth")]
        public int LevelDepth { get; set; }

        [ForeignKey("ParentId")]
        [ScriptIgnore]
        public  OperationType Parent { get; set; }

        public ICollection<OperationType> Children { get; set; }

    }
}
